using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using System.Xml.Linq;


namespace Avinor.NET
{
    public class AvinorAirportParser : AvinorParser

    {
        public AvinorAirportParser(Stream stream) : base(stream) {}

        public IEnumerable<Airport> GetAirports()
        {
            var airports = from airportName in  GetDescendants("airportName")
                select new Airport()
                   {
                       Code = airportName.Attribute("code").Value,
                       Name = airportName.Attribute("name").Value

                   };
            return airports;

        }


    }
}